{extend name="panel/layout" /}
{block name="main"}
<div class="row">
    <div class="col-sm-12">
        <h4 class="page-title">
            <ul class="breadcrumb">
                <li><i class="fa fa-home"></i><a href="/"> 首页</a></li>
                <li><i class="fa fa-desktop"></i><a href="{:url('index')}"> 控制面板</a></li>
                <li class="active">添加/更新QQ</li>
            </ul>
        </h4>
    </div>
</div>
<div class="row">
    <div class="col-xs-12">
        <div class="panel panel-danger">
            <div class="panel-body">
                {:getHtmlCode(config('web_gg_qqadd'))}
            </div>
        </div>
    </div>
</div>
<div class="row">
    <div class="col-lg-12">
        <div class="panel panel-primary">
            <div class="panel-heading">
                <i class="icon-user"></i>添加/更新QQ
            </div>
            <div class="panel-body text-center">
			{if condition="config('zz_addqq_mode') eq 1"}
				<form method="post" class="alert alert-success">
                    <div class="form-group">
                        <div class="input-group">
                            <div class="input-group-addon">
                                ＱＱ
                            </div>
                            <input type="text" name="uin" class="form-control" value="{if condition='isset($qqInfo)'}{$qqInfo.uin}{/if}" required>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="input-group">
                            <div class="input-group-addon">
                                密码
                            </div>
                            <input type="text" name="pwd" class="form-control" value="" required>
                        </div>
                    </div>
                    <input type="submit" name="submit" value="确认添加" class="btn btn-danger btn-block">
                </form>
			{else}
                <Iframe id="iframepage"
                        src="/qlogin/{if condition='isset($qqInfo)'}?uin={$qqInfo.uin}&pwd={$qqInfo.pwd}{/if}"
                        width="100%" scrolling="no" frameborder="0" name="addFrame"></iframe>
			{/if}
            </div>
        </div>
    </div>
</div>
{/block}
{block name="footJs"}
<script type="text/javascript">
    function reinitIframe() {
        var iframe = document.getElementById("iframepage");
        try {
            iframe.height = iframe.contentWindow.document.documentElement.scrollHeight;
        } catch (ex) {
        }
    }
    window.setInterval("reinitIframe()", 200);
    function showLoad() {
        sweetAlert({
            title: "添加中...",
            text: '请耐心等待，如很长时间都没反应，请刷新网页重新添加！',
            imageUrl: "/assets/load.gif",
            html: true,
            timer: 600000,
            showConfirmButton: false
        });
    }
    function closeLoad() {
        $('.confirm').click();
    }
</script>

{/block}